<%@ page import="com.oval.util.JspHelper" %>
<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>

<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="css/chinese/csscontent.css" type="text/css">
<script language="JavaScript">

function MM_callJS(jsStr) { <%--[SCRIPT]  v2.0  [SCRIPT]--%>
  return eval(jsStr)
}
<%--[SCRIPT]    [SCRIPT]--%>
function set_level()
{
  document.form1.actionname.value = "SetLevel";
  document.form1.submit();
}
function set_element()
{
  document.form1.actionname.value = "SetElement";
  document.form1.submit();
}
function delete_element()
{
  document.form1.actionname.value = "DeleteElement";
  document.form1.submit();
}
</script>
</head>
<%
Iterator it = com.oval.foundation.util.Logger.getLimitElements();
   Vector jobs = new Vector(100,10);
   String zzz = new String("zzz");
   jobs.add(zzz);
   Vector jobunits = new Vector(100,10);
   jobunits.add(zzz);
   Vector components = new Vector(100,10);
   components.add(zzz);
   Vector conditions = new Vector(100,10);
   conditions.add(zzz);
   String name = null;
   while(it.hasNext())
   {
     name = (String)it.next();
     if(com.oval.foundation.util.Logger.getType(name).equalsIgnoreCase("job"))
       jobs.add(name);
     else 
     {
       if(com.oval.foundation.util.Logger.getType(name).equalsIgnoreCase("jobunit"))
         jobunits.add(name);
       else
       {
         if(com.oval.foundation.util.Logger.getType(name).equalsIgnoreCase("component"))
           components.add(name);
         else
         {
           if(com.oval.foundation.util.Logger.getType(name).equalsIgnoreCase("condition"))
             conditions.add(name);
         }
       }
     }
   }
%>

<body bgcolor="#FFFFFF" text="#000000">


<form name="form1" method="post" action="../Dispatcher">
  <oval:hidden property="pagename" value="SetLevel"/>
  <oval:hidden property="actionname"/>
  <table width="100%" height="100%" border="0" class="blue-right">
  
  
   <tr> 
      <td class="blue-deep" height="4"> 
        <div align="center">Limit Debug Level:</div>
    </td>
  </tr>
  <tr>
  
      <td height="31"> 
          <table width="100%" border="0">
            
          </table>
        <table width="100%" border="0">
          <tr>
            <td> 
              <div align="center">
                <select name="level">
                  <option value="1">1</option>
                  <option value="2">2</option>
                  <option value="3">3</option>
                  <option value="4">4</option>
                  <option value="5">5</option>
                </select>
              </div>
            </td>
          </tr>
          <tr>
            <td>&nbsp; 
              
            </td>
          </tr>
          <tr>
            <td>
              <div align="center">
                <input type="image" border="0" name="imageField2" src="images/chinese/bt-done.gif" width="57" height="18" onClick="MM_callJS('set_level()')">
              </div>
            </td>
          </tr>
        </table>
      </td>
  </tr>
  <tr> 
    <td class="blue-deep" height="23"> 
        <div align="center">Limited Workflow Element:</div>
    </td>
  </tr>
  <tr>
  
    <td height="23">
        <table width="100%" border="0">
          <tr> 
            <td width="20%"> 
              <div align="center">Jobs:</div>
            </td>
            <td width="30%">
              <div align="left">  
                <select name="job" multiple>
<% it = com.oval.foundation.container.JobContainer.getJobMetas();
   while(it.hasNext())
   {
     com.oval.foundation.metadata.workflow.ComponentEntity ent = (com.oval.foundation.metadata.workflow.ComponentEntity)it.next();
     name = ent.getName();
     if(!jobs.contains(name))
     {%>
                  <option value="<%=JspHelper.filterNull( name )%>"><%=JspHelper.filterNull( name )%></option>
                  <% }} %>
                  <option value="haha">                                </option>
                </select>
              </div>
            </td>
            <td width="20%"> 
              <div align="center">Limit Jobs: </div>
            </td>
            <td width="30%">  
              <div align="left">
                <select name="job1" multiple>
<%   while(!jobs.isEmpty())
     {
       name = (String)jobs.firstElement();
       jobs.remove(name);
       if(!name.equalsIgnoreCase("zzz"))
       {  %>
                  <option value="<%=JspHelper.filterNull( name )%>"><%=JspHelper.filterNull( name )%></option>
                  <% }} %>
                  <option value="haha">                                </option>
                </select>
              </div>
            </td>
            </tr>
            <tr>
            <td width="20%"> 
              <div align="center">Components: </div>
            </td>
            <td width="30%">  
              <div align="left">
                <select name="component" multiple>
<% it = com.oval.foundation.container.ComponentContainer.getComponentMetas();
     while(it.hasNext())
     {
       com.oval.foundation.metadata.workflow.ComponentEntity ent = (com.oval.foundation.metadata.workflow.ComponentEntity)it.next();
       name = ent.getName();
       if(!components.contains(name))  
      {%>
                  <option value="<%=JspHelper.filterNull( name )%>"><%=JspHelper.filterNull( name )%></option>
                  <% }} %>
                  <option value="haha">                                </option>
                </select>
              </div>
            </td>
            <td width="20%"> 
              <div align="center">Limit Components: </div>
            </td>
            <td width="30%">  
              <div align="left">
                <select name="component1" multiple>
<%   while(!components.isEmpty())
     {
       name = (String)components.firstElement();
       components.remove(name);
       if(!name.equalsIgnoreCase("zzz"))
       {  %>
                  <option value="<%=JspHelper.filterNull( name )%>"><%=JspHelper.filterNull( name )%></option>
                  <% }} %>
                  <option value="haha">                                </option>
                </select>
              </div>
            </td>
          </tr>
          <tr> 
            <td width="20%"> 
              <div align="center">Jobunits: </div>
            </td>
            <td width="30%">  
              <div align="left">
                <select name="jobunit" multiple>
<% it = com.oval.foundation.container.JobUnitContainer.getJobUnitMetas();
     while(it.hasNext())
     {
       com.oval.foundation.metadata.workflow.JobUnitEntity ent = (com.oval.foundation.metadata.workflow.JobUnitEntity)it.next();
       name = ent.getName();
       if(!jobunits.contains(name))  
      {%>
                  <option value="<%=JspHelper.filterNull( name )%>"><%=JspHelper.filterNull( name )%></option>
                  <% }} %>
                  <option value="haha">                                </option>
                </select>
              </div>
            </td>
            <td width="20%"> 
              <div align="center">Limit Jobunits: </div>
            </td>
            <td width="30%">  
              <div align="left">
                <select name="jobunit1" multiple>
<%   while(!jobunits.isEmpty())
     {
       name = (String)jobunits.firstElement();
       jobunits.remove(name);
       if(!name.equalsIgnoreCase("zzz"))
       {  %>
                  <option value="<%=JspHelper.filterNull( name )%>"><%=JspHelper.filterNull( name )%></option>
                  <% }} %>
                  <option value="haha">                                </option>
                </select>
              </div>
            </td>
            </tr>
            <tr>
            <td width="20%"> 
              <div align="center">Conditions:</div>
            </td>
            <td width="30%">  
              <div align="left">
                <select name="condition" multiple>
<% it = com.oval.foundation.container.ConditionContainer.getConditionMetas();
     while(it.hasNext())
     {
       com.oval.foundation.metadata.workflow.ConditionEntity ent = (com.oval.foundation.metadata.workflow.ConditionEntity)it.next();
       name = ent.getName();
       if(!conditions.contains(name))  
      {%>
                  <option value="<%=JspHelper.filterNull( name )%>"><%=JspHelper.filterNull( name )%></option>
                  <% }} %>
                  <option value="haha">                                </option>
                </select>
              </div>
            </td>
            <td width="20%"> 
              <div align="center">Limit Conditions: </div>
            </td>
            <td width="30%">  
              <div align="left">
                <select name="condition1" multiple>
<%   while(!conditions.isEmpty())
     {
       name = (String)conditions.firstElement();
       conditions.remove(name);
       if(!name.equalsIgnoreCase("zzz"))
       {  %>
                  <option value="<%=JspHelper.filterNull( name )%>"><%=JspHelper.filterNull( name )%></option>
                  <% }} %>
                  <option value="haha">                                </option>
                </select>
              </div>
            </td>
          </tr>
        </table>
      </td>
  </tr>
  <td> 
    <div align="center"> 
      
          <table width="100%" border="0" align="center">
            <tr> 
              <td width="100%"> 
                <table width="100%" border="0" align="center">
                  <tr> 
                    <td width="50%"> 
                      <div align="center"> 
                        <input type="image" border="0" name="imageField22" src="images/chinese/bt-done.gif" width="57" height="18" onClick="MM_callJS('set_element()')">
                      </div>
                    </td>
                    <td width="50%"> 
                      <div align="center"> 
                        <input type="image" border="0" name="imageField23" src="images/chinese/bt-delete.gif" width="57" height="18" onClick="MM_callJS('delete_element()')">
                      </div>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
            <tr> 
              <td width="100%" class="blue-right"> 
                <div align="center"> 
                  <p>&nbsp;</p><p><input type="image" border="0" name="imageField" src="images/chinese/bt-close.gif" width="57" height="18" onClick="MM_callJS('window.close()')">
                </p></div>
              </td>
            </tr>
          </table>
        
          
        </div>
  </td>
</table>
</form>
</body>
</html>


